<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2020/9/20
  Time: 19:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登陆页面</title>
</head>
<body>
<%--<%
    //声明一个username
    String username = "";
    //声明一个pwd
    String pwd = "";
    //声明一个ck
    String ck = "";

    //获取cookie信息
    Cookie[] cookies = request.getCookies();
    //判断cookies是否为空 并且长度大于0
    if (cookies != null && cookies.length > 0) {
        //遍历cookies
        for (Cookie cookie : cookies) {
            //获取用户名
            if ("username".equals(cookie.getName())){
                username = cookie.getValue();
                ck = "checked";
            }
            //获取密码\
            if ("pwd".equals(cookie.getName())){
                pwd = cookie.getValue();
            }
        }
    }
%>--%>
<%--表单${pageContext.request.contextPath}/--%>
<form action="UserServlet/login" method="post">
    <%--用户登录--%>
    <%--输入用户名--%>
    用户：<input type="text" name="username" value="${cookie['username'].value}"/><br/>
    <%--输入用户密码--%>
    密码：<input type="password" name="pwd" value="${cookie['pwd'].value}"/><br/>
    <%--是否保存用户登录信息--%>
    记住我：<input type="checkbox" name="ck" value="1" ${ck ? "checked":""}/><br/>
    <%--登陆用户--%>
    <button type="submit">登陆</button>
</form>
</body>
</html>
